﻿app.factory('friendFactory', function ($http) {
    var factory = {};

    factory.getFriends = function(id) {
        return $http.get(getFriendsApiAddress + id);
    };
    factory.countFriends = function (id) {
        return $http.get(countFriendsApiAddress + id);
    };
    factory.delFriendHasId = function (id) {
        return $http.post(delFriendApiAddress+ id);
    };
    factory.delFriend = function (dataPost) {
        return $http.post(delFriendApiAddress,dataPost);
    };
    factory.postFriend = function (friendPost) {
        return $http.post(addFriendApiAddress, friendPost);
    };
    factory.checkWaitingAccept = function (friendPost) {
        return $http.post(checkWaitingAcceptApiAddress, friendPost);
    };
    return factory;
});